from redis import Redis
from copy import deepcopy

redis_cli = Redis()

def str_get(k):
    return redis_cli.get(k)

def item2dict(item):
    if isinstance(item,list):
        datas = []
        for i in item:
            datas.append(item2dict(i))
        return datas

    data = deepcopy(item.__dict__)
    data.pop('_sa_instance_state')
    return data